/**
 * Tencent is pleased to support the open source community by making Tars available.
 *
 * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * https://opensource.org/licenses/BSD-3-Clause
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************

package com.qq.tars.support.log.prx;

import com.qq.tars.protocol.util.*;
import com.qq.tars.protocol.annotation.*;
import com.qq.tars.protocol.tars.*;
import com.qq.tars.protocol.tars.annotation.*;

@TarsStruct
public class LogInfo {

	@TarsStructProperty(order = 0, isRequire = true)
	public String appname = "";
	@TarsStructProperty(order = 1, isRequire = true)
	public String servername = "";
	@TarsStructProperty(order = 2, isRequire = true)
	public String sFilename = "";
	@TarsStructProperty(order = 3, isRequire = true)
	public String sFormat = "";
	@TarsStructProperty(order = 4, isRequire = false)
	public String setdivision = "";
	@TarsStructProperty(order = 5, isRequire = false)
	public boolean bHasSufix = true;
	@TarsStructProperty(order = 6, isRequire = false)
	public boolean bHasAppNamePrefix = true;
	@TarsStructProperty(order = 7, isRequire = false)
	public boolean bHasSquareBracket = false;
	@TarsStructProperty(order = 8, isRequire = false)
	public String sConcatStr = "_";
	@TarsStructProperty(order = 9, isRequire = false)
	public String sSepar = "|";
	@TarsStructProperty(order = 10, isRequire = false)
	public String sLogType = "";

	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	public String getServername() {
		return servername;
	}

	public void setServername(String servername) {
		this.servername = servername;
	}

	public String getSFilename() {
		return sFilename;
	}

	public void setSFilename(String sFilename) {
		this.sFilename = sFilename;
	}

	public String getSFormat() {
		return sFormat;
	}

	public void setSFormat(String sFormat) {
		this.sFormat = sFormat;
	}

	public String getSetdivision() {
		return setdivision;
	}

	public void setSetdivision(String setdivision) {
		this.setdivision = setdivision;
	}

	public boolean getBHasSufix() {
		return bHasSufix;
	}

	public void setBHasSufix(boolean bHasSufix) {
		this.bHasSufix = bHasSufix;
	}

	public boolean getBHasAppNamePrefix() {
		return bHasAppNamePrefix;
	}

	public void setBHasAppNamePrefix(boolean bHasAppNamePrefix) {
		this.bHasAppNamePrefix = bHasAppNamePrefix;
	}

	public boolean getBHasSquareBracket() {
		return bHasSquareBracket;
	}

	public void setBHasSquareBracket(boolean bHasSquareBracket) {
		this.bHasSquareBracket = bHasSquareBracket;
	}

	public String getSConcatStr() {
		return sConcatStr;
	}

	public void setSConcatStr(String sConcatStr) {
		this.sConcatStr = sConcatStr;
	}

	public String getSSepar() {
		return sSepar;
	}

	public void setSSepar(String sSepar) {
		this.sSepar = sSepar;
	}

	public String getSLogType() {
		return sLogType;
	}

	public void setSLogType(String sLogType) {
		this.sLogType = sLogType;
	}

	public LogInfo() {
	}

	public LogInfo(String appname, String servername, String sFilename, String sFormat, String setdivision, boolean bHasSufix, boolean bHasAppNamePrefix, boolean bHasSquareBracket, String sConcatStr, String sSepar, String sLogType) {
		this.appname = appname;
		this.servername = servername;
		this.sFilename = sFilename;
		this.sFormat = sFormat;
		this.setdivision = setdivision;
		this.bHasSufix = bHasSufix;
		this.bHasAppNamePrefix = bHasAppNamePrefix;
		this.bHasSquareBracket = bHasSquareBracket;
		this.sConcatStr = sConcatStr;
		this.sSepar = sSepar;
		this.sLogType = sLogType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + TarsUtil.hashCode(appname);
		result = prime * result + TarsUtil.hashCode(servername);
		result = prime * result + TarsUtil.hashCode(sFilename);
		result = prime * result + TarsUtil.hashCode(sFormat);
		result = prime * result + TarsUtil.hashCode(setdivision);
		result = prime * result + TarsUtil.hashCode(bHasSufix);
		result = prime * result + TarsUtil.hashCode(bHasAppNamePrefix);
		result = prime * result + TarsUtil.hashCode(bHasSquareBracket);
		result = prime * result + TarsUtil.hashCode(sConcatStr);
		result = prime * result + TarsUtil.hashCode(sSepar);
		result = prime * result + TarsUtil.hashCode(sLogType);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof LogInfo)) {
			return false;
		}
		LogInfo other = (LogInfo) obj;
		return (
			TarsUtil.equals(appname, other.appname) &&
			TarsUtil.equals(servername, other.servername) &&
			TarsUtil.equals(sFilename, other.sFilename) &&
			TarsUtil.equals(sFormat, other.sFormat) &&
			TarsUtil.equals(setdivision, other.setdivision) &&
			TarsUtil.equals(bHasSufix, other.bHasSufix) &&
			TarsUtil.equals(bHasAppNamePrefix, other.bHasAppNamePrefix) &&
			TarsUtil.equals(bHasSquareBracket, other.bHasSquareBracket) &&
			TarsUtil.equals(sConcatStr, other.sConcatStr) &&
			TarsUtil.equals(sSepar, other.sSepar) &&
			TarsUtil.equals(sLogType, other.sLogType) 
		);
	}

	public void writeTo(TarsOutputStream _os) {
		if (null != appname) {
			_os.write(appname, 0);
		}
		if (null != servername) {
			_os.write(servername, 1);
		}
		if (null != sFilename) {
			_os.write(sFilename, 2);
		}
		if (null != sFormat) {
			_os.write(sFormat, 3);
		}
		if (null != setdivision) {
			_os.write(setdivision, 4);
		}
		_os.write(bHasSufix, 5);
		_os.write(bHasAppNamePrefix, 6);
		_os.write(bHasSquareBracket, 7);
		if (null != sConcatStr) {
			_os.write(sConcatStr, 8);
		}
		if (null != sSepar) {
			_os.write(sSepar, 9);
		}
		if (null != sLogType) {
			_os.write(sLogType, 10);
		}
	}

	public void readFrom(TarsInputStream _is) {
		this.appname = _is.read(appname, 0, true);
		this.servername = _is.read(servername, 1, true);
		this.sFilename = _is.read(sFilename, 2, true);
		this.sFormat = _is.read(sFormat, 3, true);
		this.setdivision = _is.read(setdivision, 4, false);
		this.bHasSufix = _is.read(bHasSufix, 5, false);
		this.bHasAppNamePrefix = _is.read(bHasAppNamePrefix, 6, false);
		this.bHasSquareBracket = _is.read(bHasSquareBracket, 7, false);
		this.sConcatStr = _is.read(sConcatStr, 8, false);
		this.sSepar = _is.read(sSepar, 9, false);
		this.sLogType = _is.read(sLogType, 10, false);
	}

}
